//二分查找
pair<int,int> findTwoPoints(const vector<int>& v, int left, int right)
{
    std::sort(v.begin(), v.end());
    //[left,right]
    //查找v中在[left,right]的左区间
    int res_l = -1;
    int res_r = -1;
    int l = 0, r = v.size()-1;
    int mid = 0;
    while (l <= r)
    {
        mid = 1 + (r - l) / 2;
        if (v[mid] >= left && v[mid] <= right) {
            res_l = mid;
            r = mid - 1;
        }
        else if (v[mid] < left) {
            l = mid + 1;
        }
        else if (v[mid] > right) {
            r = mid - 1;
        }
    }
    if (res_l == -1) {
        return pair<int, int>(-1, -1);
    }
    while (l <= r)
    {
        mid = l + (r - l) / 2;
        if (v[mid] >= left && v[mid] <= right) {
            res_r = mid;
            l = mid + 1;
        }
        else if (v[mid] < left) {
            l = mid + 1;
        }
        else if (v[mid] > right) {
            r = mid - 1;
        }
    }
    return make_pair(res_l, res_r);
}